home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 30
/
Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso
/
Aminet
/
misc
/
sci
/
WorldMap_bin.lha
/
WorldMap
/
Src
/
WMPrefs.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-15
|
3KB
|
89 lines
//Program IFF;
#include <exec/types.h>
#include <libraries/reqtools.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <clib/reqtools_protos.h>
#include <pragma/reqtools.h>
#include <WMap.h>
#include <iostream.h>
#include <string.h>
#include <wbstartup.h>
struct Library *IntuitionBase=NULL;
struct Library *GfxBase=NULL;
struct Library *DBase=NULL;
struct Library *ReqToolsBase=NULL;
WPreferences WPrefs;
rtScreenModeRequester *MySReq=NULL;
//APTR a;
LONG l;
BPTR FHandle;
void main(void)
{
IntuitionBase=OpenLibrary("intuition.library",39);
if (IntuitionBase)
{
GfxBase=OpenLibrary("graphics.library",39);
if (GfxBase)
{
DBase=OpenLibrary("dos.library",39);
if (DBase)
{
ReqToolsBase=OpenLibrary("reqtools.library",0);
if (ReqToolsBase)
{
rtEZRequest("Please select a screen with\n a size of 640x512 at least!","OK",NULL,NULL);
MySReq=(rtScreenModeRequester*)rtAllocRequestA(RT_SCREENMODEREQ,NULL);
if (MySReq)
{
MySReq->Flags=SCREQB_SIZEGADS;
rtChangeReqAttr(MySReq,0,TAG_DONE);
if (rtScreenModeRequest(MySReq,"Select a new screenmode!",TAG_DONE,0))
/* RTSC_MinWidth,640,
RTSC_MinHeight,512,
RTSC_MinDepth,8,
TAG_DONE,0))*/
{
WPrefs.ScrID=MySReq->DisplayID;
WPrefs.Width=((UWORD)(MySReq->DisplayWidth/160)*160);
if (WPrefs.Width<640) WPrefs.Width=640;
WPrefs.Height=((UWORD)(MySReq->DisplayHeight/128)-1)*128;
if (WPrefs.Height<384) WPrefs.Height=384;
}
rtFreeRequest(MySReq);
}
l=rtEZRequest("Please select a language!","Deutsch|English",NULL,NULL);
if (l==1) strcpy(WPrefs.Lang,"deutsch") else strcpy(WPrefs.Lang,"english");
FHandle=Open(WPrefsPath,MODE_NEWFILE);
if (FHandle)
{
Write(FHandle,&WPrefs,sizeof(WPreferences));
Close(FHandle);
}
CloseLibrary(ReqToolsBase);
}
else cout << "Couldn't open reqtools.library!\n";
CloseLibrary(DBase);
}
else cout << "Couldn´t open dos.library!\n";
CloseLibrary(GfxBase);
}
else cout << "Couldn´t open gfx.library!\n";
CloseLibrary(IntuitionBase);
}
else cout << "Couldn´t open intuition.library!\n";
}